<?php
namespace BP\GPM;
require_once("BP/En/Map.php");
class DeptStation extends Entity {
	public function getHisUAC () 
	{
		$uac = new UAC();
		$uac->OpenForSysAdmin();
		return $uac;
	}
	public function getFK_Dept () 
	{
		return $this->GetValStringByKey(DeptStationAttr::$FK_Dept);
	}
	public function setFK_Dept ($value) // [String value]
	{
		$this->SetValByKey(DeptStationAttr::$FK_Dept, $value);
	}
	public function getFK_StationT () 
	{
		return $this->GetValRefTextByKey(DeptStationAttr::$FK_Station);
	}
	public function getFK_Station () 
	{
		return $this->GetValStringByKey(DeptStationAttr::$FK_Station);
	}
	public function setFK_Station ($value) // [String value]
	{
		$this->SetValByKey(DeptStationAttr::$FK_Station, $value);
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public static function constructor__String_String ($deptid, $stationid) // [String deptid, String stationid]
	{
		$me = new self();
		$me->setFK_Dept($deptid);
		$me->setFK_Station($stationid);
		if (($me->Retrieve(DeptStationAttr::$FK_Dept, $me->getFK_Dept(), DeptStationAttr::$FK_Station, $me->getFK_Station()) == 0))
		{
			$me->Insert();
		}
		return $me;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Port_DeptStation");
		$map->setEnDesc("部门岗位对应");
		$map->Java_SetEnType($EnType->Dot2Dot);
		$map->AddTBStringPK(DeptStationAttr::$FK_Dept, NULL, "部门",  FALSE ,  FALSE , 1, 15, 1);
		$map->AddDDLEntitiesPK(DeptStationAttr::$FK_Station, NULL, "岗位", Stations::constructor__(),  TRUE );
		$map->AddSearchAttr(DeptStationAttr::$FK_Station);
		$this->set_enMap($map);
		return $this->get_enMap();
	}
}
?>
